import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class Ventana extends JFrame {

	private JPanel contentPane;
	private JTextField textFieldNombreAdmin;
	private JTextField textFieldPassAdmin;
	private JTextField textFieldLegajoInspector;
	private JTextField textFieldPassInspector;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Ventana frame = new Ventana();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Ventana() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 400, 300);
		contentPane = new JPanel();
		contentPane.setBackground(Color.RED);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		//PANEL INICIO
		JPanel panelInicio = new JPanel();
		panelInicio.setBounds(0, 0, 384, 261);
		contentPane.add(panelInicio);
		panelInicio.setLayout(null);
	
		JLabel lblSeleccionusuario = new JLabel("Ingresar como:");
		lblSeleccionusuario.setBounds(73, 25, 226, 68);
		panelInicio.add(lblSeleccionusuario);
		lblSeleccionusuario.setHorizontalAlignment(SwingConstants.CENTER);
		lblSeleccionusuario.setOpaque(true);
		
		JButton btnButtonadmin = new JButton("Administrador");
		btnButtonadmin.setBounds(122, 103, 150, 40);
		panelInicio.add(btnButtonadmin);
		
		JButton btnButtoninspector = new JButton("Inspector");
		btnButtoninspector.setBounds(122, 167, 150, 40);
		panelInicio.add(btnButtoninspector);
		
		//PANEL LOG ADMIN
		JPanel panelLogAdmin = new JPanel();
		panelLogAdmin.setBounds(0, 0, 384, 261);
		//contentPane.add(panelLogAdmin);
		panelLogAdmin.setLayout(null);
		
		JLabel lblNombreAdmin = new JLabel("Nombre de Usuario:");
		lblNombreAdmin.setHorizontalAlignment(SwingConstants.CENTER);
		lblNombreAdmin.setBounds(25, 80, 150, 40);
		panelLogAdmin.add(lblNombreAdmin);
		
		JLabel lblPassusuario = new JLabel("Password");
		lblPassusuario.setHorizontalAlignment(SwingConstants.CENTER);
		lblPassusuario.setBounds(25, 142, 150, 40);
		panelLogAdmin.add(lblPassusuario);
		
		textFieldNombreAdmin = new JTextField();
		textFieldNombreAdmin.setBounds(220, 80, 120, 40);
		panelLogAdmin.add(textFieldNombreAdmin);
		textFieldNombreAdmin.setColumns(10);
		
		textFieldPassAdmin = new JTextField();
		textFieldPassAdmin.setBounds(220, 142, 120, 40);
		panelLogAdmin.add(textFieldPassAdmin);
		textFieldPassAdmin.setColumns(10);
		
		JButton btnAdminlogin = new JButton("Ingresar");
		btnAdminlogin.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		btnAdminlogin.setBounds(149, 212, 89, 23);
		panelLogAdmin.add(btnAdminlogin);
		
		//PANEL LOG INSPECTOR
		JPanel panelLogInspector = new JPanel();
		panelLogInspector.setBounds(0, 0, 384, 261);
		//contentPane.add(panelLogInspector);
		panelLogInspector.setLayout(null);
		
		JLabel lblNombreInspector = new JLabel("Legajo:");
		lblNombreInspector.setHorizontalAlignment(SwingConstants.CENTER);
		lblNombreInspector.setBounds(25, 80, 150, 40);
		panelLogInspector.add(lblNombreInspector);
		
		JLabel lblPassInspector = new JLabel("Password");
		lblPassInspector.setHorizontalAlignment(SwingConstants.CENTER);
		lblPassInspector.setBounds(25, 142, 150, 40);
		panelLogInspector.add(lblPassInspector);
		
		textFieldLegajoInspector = new JTextField();
		textFieldLegajoInspector.setBounds(220, 80, 120, 40);
		panelLogInspector.add(textFieldLegajoInspector);
		textFieldLegajoInspector.setColumns(10);
		
		textFieldPassInspector = new JTextField();
		textFieldPassInspector.setBounds(220, 142, 120, 40);
		panelLogInspector.add(textFieldPassInspector);
		textFieldPassInspector.setColumns(10);
		
		JButton btnInspectorlogin = new JButton("Ingresar");
		btnInspectorlogin.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		btnInspectorlogin.setBounds(149, 212, 89, 23);
		panelLogInspector.add(btnInspectorlogin);

		
		
		btnButtoninspector.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				contentPane.remove(panelInicio);
				contentPane.repaint();
				contentPane.add(panelLogInspector);

			}
		});
		btnButtonadmin.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				contentPane.remove(panelInicio);
				contentPane.repaint();
				contentPane.add(panelLogAdmin);
			}

		});
	}
}
